home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 19.zip / BS1 part 19 / Lattice C disk 4.adf / Compiler_Headers / graphics / copper.h < prev    next >
C/C++ Source or Header  |  1988-10-25  |  2KB  |  84 lines

  1. #ifndef GRAPHICS_COPPER_H
  2. #define GRAPHICS_COPPER_H
  3. /*
  4. **    $Filename: graphics/copper.h $
  5. **    $Release: 1.3 $
  6. **
  7. **    
  8. **
  9. **    (C) Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #define COPPER_MOVE 0        /* pseude opcode for move #XXXX,dir */
  14. #define COPPER_WAIT 1        /* pseudo opcode for wait y,x */
  15. #define CPRNXTBUF   2        /* continue processing with next buffer */
  16. #define CPR_NT_LOF  0x8000  /* copper instruction only for short frames */
  17. #define CPR_NT_SHT  0x4000  /* copper instruction only for long frames */
  18. struct CopIns
  19. {
  20.     short   OpCode; /* 0 = move, 1 = wait */
  21.     union
  22.     {
  23.     struct CopList *nxtlist;
  24.     struct 
  25.     {
  26.    union
  27.    {
  28.    SHORT   VWaitPos;        /* vertical beam wait */
  29.    SHORT   DestAddr;        /* destination address of copper move */
  30.    } u1;
  31.    union
  32.    {
  33.    SHORT   HWaitPos;        /* horizontal beam wait position */
  34.    SHORT   DestData;        /* destination immediate data to send */
  35.    } u2;
  36.     } u4;
  37.     } u3;
  38. };
  39. /* shorthand for above */
  40. #define NXTLIST        u3.nxtlist
  41. #define VWAITPOS    u3.u4.u1.VWaitPos
  42. #define DESTADDR    u3.u4.u1.DestAddr
  43. #define HWAITPOS    u3.u4.u2.HWaitPos
  44. #define DESTDATA    u3.u4.u2.DestData
  45.  
  46.  
  47. /* structure of cprlist that points to list that hardware actually executes */
  48. struct cprlist
  49. {
  50.     struct cprlist *Next;
  51.     UWORD   *start;        /* start of copper list */
  52.     SHORT   MaxCount;        /* number of long instructions */
  53. };
  54.  
  55. struct CopList
  56. {
  57.     struct  CopList *Next;  /* next block for this copper list */
  58.     struct  CopList *_CopList;    /* system use */
  59.     struct  ViewPort *_ViewPort;    /* system use */
  60.     struct  CopIns *CopIns; /* start of this block */
  61.     struct  CopIns *CopPtr; /* intermediate ptr */
  62.     UWORD   *CopLStart;        /* mrgcop fills this in for Long Frame*/
  63.     UWORD   *CopSStart;        /* mrgcop fills this in for Short Frame*/
  64.     SHORT   Count;        /* intermediate counter */
  65.     SHORT   MaxCount;        /* max # of copins for this block */
  66.     SHORT   DyOffset;        /* offset this copper list vertical waits */
  67. };
  68.  
  69. struct UCopList
  70. {
  71.     struct UCopList *Next;
  72.     struct CopList  *FirstCopList; /* head node of this copper list */
  73.     struct CopList  *CopList;       /* node in use */
  74. };
  75.  
  76. struct copinit
  77. {
  78.     UWORD diagstrt[4];        /* copper list for first bitplane */
  79.     UWORD sprstrtup[(2*8*2)+2+(2*2)+2];
  80.     UWORD   sprstop[2];
  81. };
  82.  
  83. #endif    /* GRAPHICS_COPPER_H */
  84.